<!DOCTYPE html>
<html lang="en" xmlns:color="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
    <script src="../js/axios.js"></script>
    <script src="../js/util.js"></script>
</head>
<body>
<div id="a">
    <center><h2> 学生统计数据：</h2></center>
    <br>
    <div v-for="s in list" style="color: red"><font style="color:black;">总分最高的学生:</font>{{s.sname}},{{s.num}}分</div>
    每科分数最高的学生及分数: <span v-for="k in arrays" style="color: red">{{k.name}}--{{k.sname}}--{{k.num}}&nbsp;</span>
    <br>
    每个学生的总分: <span v-for="a in array" style="color: red">{{a.sname}}--{{a.num}}&nbsp;</span>
</div>
<script>
    new Vue({
        el: "#a",
        data: {
            list: [],
            array: [],
            arrays: []
        },
        created() {
            this.findStuByMaxScore()
            this.findStuBySumScore()
            this.findStuScoreCourseByMaxCourse()
        },
        methods: {
            findStuScoreCourseByMaxCourse() {
                axios.post("/sys/statistics/findStuScoreCourseByMaxCourse").then(res => {
                    this.arrays = res.data.data
                })
            },
            findStuByMaxScore() {
                axios.post("/sys/statistics/findStuByMaxScore").then(res => {
                    this.list = res.data.data
                })
            },
            findStuBySumScore() {
                axios.post("/sys/statistics/findStuBySumScore").then(res => {
                    this.array = res.data.data
                })
            }
        }
    })
</script>
</body>
</html>